-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added deviceorientationabsolute
so absolute positioning with Android Chrome works
#25
base: master
Are you sure you want to change the base?
Conversation
This breaks support for firefox mobile, with the error DeviceOrientation is not supported. |
if (event.absolute === true) { | ||
orientationChangeAbsolute = true; | ||
} | ||
if (event.absolute == orientationChangeAbsolute) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaks support for non-absolute browsers, like firefox mobile
@@ -1028,6 +1032,7 @@ FULLTILT.DeviceOrientation.prototype = { | |||
|
|||
if ( sensors.orientation.active ) { | |||
|
|||
window.removeEventListener( 'deviceorientationabsolute', handleDeviceOrientationChange, false ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix issues with firefox mobile, needs to be like this
if ('ondeviceorientationabsolute' in window) {
window.addEventListener( 'deviceorientationabsolute', handleDeviceOrientationChange, false );
} else if ('ondeviceorientation' in window) {
window.addEventListener( 'deviceorientation', handleDeviceOrientationChange, false );
}
deviceorientation
does not give absolute aka 'world' positioning on android chrome anymore. This PR fixes that.I'm not sure if this breaks 'game' positioning in any way. This should be tested.